<template>
  <div>
    <div class="mt-3 ml-2">
      <el-form :inline="true" :model="params" class="demo-form-inline">
        <el-form-item label="汇总级别">
          <el-select v-model="params.sum_level" placeholder="盟市/旗县">
            <el-option label="盟市" value="盟市"></el-option>
            <el-option label="旗县" value="旗县"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="盟市">
          <el-select v-model="params.addr_city" placeholder="盟市">
            <el-option label="全区" value=""></el-option>
            <el-option label="呼市" value="呼和浩特市"></el-option>
            <el-option label="包头" value="包头市"></el-option>
            <el-option label="乌海" value="乌海市"></el-option>
            <el-option label="赤峰" value="赤峰市"></el-option>
            <el-option label="兴安盟" value="兴安盟"></el-option>
            <el-option label="呼伦贝尔" value="呼伦贝尔市"></el-option>
            <el-option label="通辽" value="通辽市"></el-option>
            <el-option label="锡林郭勒" value="锡林郭勒盟"></el-option>
            <el-option label="乌兰察布" value="乌兰察布市"></el-option>
            <el-option label="鄂尔多斯" value="鄂尔多斯市"></el-option>
            <el-option label="巴彦淖尔" value="巴彦淖尔市"></el-option>
            <el-option label="阿拉善" value="阿拉善盟"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="项目名称">
          <el-input v-model="params.project_name" placeholder="项目名称"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">查询</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div>
      <el-table
          v-loading="loading"
          border
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.8)"
          :data="tableData" style="width: 100%"
          height="800">
        <el-table-column
            fixed
            prop="city_code"
            label="城市编码"
            width="100">
        </el-table-column>
        <el-table-column
            prop="addr_city"
            label="盟市"
            width="100">
        </el-table-column>
        <el-table-column
            v-show="params.sum_level === '旗县'"
            prop="addr_county"
            label="旗县"
            width="300">
        </el-table-column>
        <el-table-column
            prop="ztz"
            label="总投资(亿元）"
            width="120">
        </el-table-column><el-table-column
            prop="sum_tz_complete"
            label="累计完成投资（亿元）"
            width="180">
        </el-table-column><el-table-column
            prop="sum_tz_get_support"
            label="已获资金支持情况（政府投资+银行贷款）（亿元）"
            width="180">
        </el-table-column><el-table-column
            prop="sum_tz_needs"
            label="融资需求（亿元）"
            width="180">
        </el-table-column>
        <el-table-column
            prop="sum_result_jn"
            label="节能效果（年节约XX吨标准煤）"
            width="230">
        </el-table-column><el-table-column
            prop="sum_result_jt"
            label="降碳效果（年减排二氧化碳XX吨）"
            width="240">
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
export default {
  name: "demo-table",
  data() {
    return {
      loading: true,
      tableData: [],
      params: {
        sum_level: '',
        addr_city: '',
        project_name: ''
      },
    }
  },
  mounted() {
    this.initData();
  },
  methods: {
    initData() {
      debugger;
      this.loading = true;
      this.$axios.post('/api/demo/fgwTableListSum',this.params).then(res => {
        this.tableData = res.data.data;
        this.loading = false;
      }).catch(err=>{
        this.tableData = [];
        this.loading = false;
      })
    },
    onSubmit() {
      this.initData();
    },

  }
}
</script>

<style scoped>

</style>
